﻿<div class="sponsor-message">
    
    <div class="agent-banner">
        <h2>最新合作</h2>
        <div class="agent-slogan">
            <a href="/agent/register.html">免费注册申请 获取赞助先机</a>
        </div>
    </div>
    <div class="sponsor-message-main mt0">
        <div class="wrap sponsorWrap" id="sponsorWrap">
            <ul id="spon-ul1">
                <li ng-repeat="x in names">
                    <div class="clearfix">
                        <span class="main-color fl">￥{{x.Amount}}元 </span>
                        <span class="fr">{{x.SignDate}}</span>
                    </div>
                    <p class="text-overflow">{{x.ProjectName}}</p>
                    <p class="text-overflow">{{x.CreatorName}}</p>
                    <p class="text-overflow">{{x.ContractorName}}</p>
                </li>
            </ul>
            <ul id="spon-ul2"></ul>
        </div>
    </div>
</div>
<script>
var PAGE = {
        scrollView: function (speed, firstId, secondId, thirdId) {
            //速度设置
            var speed = speed;
            var colee2 = document.getElementById(thirdId);
            var colee1 = document.getElementById(secondId);
            var colee = document.getElementById(firstId);
            
            if(colee1.offsetHeight < colee.offsetHeight) return false; //子元素高度小于父元素，足够容纳子元素，不用轮播

            colee2.innerHTML = colee1.innerHTML; //克隆colee1为colee2
            function Marquee1() {
                //当滚动至colee1与colee2交界时
                if (colee2.offsetTop - colee.scrollTop <= 0) {
                    colee.scrollTop -= colee1.offsetHeight; //colee跳到最顶端
                } else {
                    colee.scrollTop++
                }
            }
            var MyMar1 = setInterval(Marquee1, speed) //设置定时器
            //鼠标移上时清除定时器达到滚动停止的目的
            colee.onmouseover = function () {
                clearInterval(MyMar1)
            }
            //鼠标移开时重设定时器
            colee.onmouseout = function () {
                MyMar1 = setInterval(Marquee1, speed)
            }
        }
    }
$(function(){
     setTimeout(function(){
        PAGE.scrollView(20, 'sponsorWrap', 'spon-ul1', 'spon-ul2');
        if (common.checkValue($("#scrollView")[0])){
            PAGE.scrollView(30, 'scrollView', 'scrollV-wrap1', 'scrollV-wrap2');
        }
    },100)
})

    

        //右边滚动栏
        /*PAGE.scrollView(20, 'sponsorWrap', 'spon-ul1', 'spon-ul2');

        if (common.checkValue($("#scrollView")[0])){
            PAGE.scrollView(30, 'scrollView', 'scrollV-wrap1', 'scrollV-wrap2');
        } */   
        //右边滚动栏

      /*window.onload = function(){
          
      }*/
    

    //中部滚动栏
    //PAGE.scrollView(50, 'scrollingNew', 'scrollingNew1', 'scrollingNew2');

</script>
